{% extends 'base.html' %}


{% block html_title %}
    Review Info
{% endblock %}


{% block html_body_nav_ol %}

    <li class="breadcrumb-item"><a href="{% url 'home' %}">Home</a></li>
    <li class="breadcrumb-item"><a href="{% url 'review:index' %}">Review</a></li>
    <li class="breadcrumb-item active" aria-current="page">Profile</li>

{% endblock %}


{% block html_body %}

    <table class="table table-striped align-middle">
        <thead>
        <tr>
            <td colspan="6"></td>
            <td>
                <a class="btn btn-info" href="{% url 'review:profile-create' %}" role="button">New</a>
            </td>
        </tr>
        <tr>
            <th scope="col">#</th>
            <th scope="col">Name</th>
            <th scope="col">Repository</th>
            <th scope="col">Branch</th>
            <th scope="col">People</th>
            <th scope="col">Groups</th>
            <th scope="col">Action</th>
        </tr>
        </thead>
        <tbody>

        {% for profile in review_profile_list %}
            <tr>

                <th> {{ forloop.counter }} </th>
                <td class="fw-bold text-primary"> {{ profile.profile_name }} </td>
                <td> {{ profile.review_repository }} </td>
                <td> {{ profile.review_branch }} </td>
                <td> {{ profile.review_target_people }} </td>
                <td> {{ profile.review_target_groups }} </td>
                <td style="width: 200px !important;">

                    <div class="row flex-nowrap justify-content-end">
                        <div class="col-6 pr-0 ">
                            <a class="w-75 btn btn-info p-0" href="{% url 'review:profile-update' pk=profile.id %}"
                               role="button">Update</a>
                        </div>
                        <div class="col-6 pl-0 ">
                            <a class="w-75 btn btn-secondary p-0" href="{% url 'review:profile-delete' pk=profile.id %}"
                               role="button">Delete</a>
                        </div>
                    </div>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <div class="pagination">
    <span class="step-links">
        {% if page_obj.has_previous %}
            <a href="?page=1">&laquo; first</a>
            <a href="?page={{ page_obj.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }}.
        </span>

        {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}">next</a>
            <a href="?page={{ page_obj.paginator.num_pages }}">last &raquo;</a>
        {% endif %}
    </span>
    </div>
{% endblock %}